<?php
class ArticleModel extends Model {
	protected $tableName='article';
	public function selart(){
		$sql='select a.*,c.cateName from article as a,article_cate as c where a.cate_id=c.id';
		$res=mysql_query($sql);
		$array=array();
		while ($row=mysql_fetch_assoc($res)) {
			$array[]=$row;
		}
		return $array;
	}
	/**
	 * 获取文章信息
	 *
	 * @param int $mark 1表示系统帮助，2表示普通快讯，3表示单页管理
	 * @return unknown
	 */
	public function selfooter($mark){
		$sql='select a.id,a.title,a.art_url,a.cate_id,c.cateName from article as a,article_cate as c where a.cate_id=c.id and a.status=1 and c.mark='.$mark.' order by c.id';
		$res=mysql_query($sql);
		$array=array();
		while ($row=mysql_fetch_assoc($res)) {
			$array[]=$row;
		}
		return $array;
	}
	
	
}
?>